package com.example.starseas_phone.Adapters;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.example.starseas_phone.Entity.Evaluation;
import com.example.starseas_phone.Entity.ScoreManage;
import com.example.starseas_phone.R;

import java.util.List;

public class Apply_ScoreManagelistviewAdapter extends ArrayAdapter<ScoreManage> {
    private int id;
    private Context mcontext;

    public Apply_ScoreManagelistviewAdapter(@NonNull Context context, int resource, @NonNull List<ScoreManage> objects) {
        super(context, resource, objects);
        id = resource;
        mcontext = context;
    }

    @NonNull
    @Override
    public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
        ScoreManage scoreManage = getItem(position);
        View view = LayoutInflater.from(parent.getContext()).inflate(id,parent,false);
        TextView apply_score_manage_listview_StuName = (TextView) view.findViewById(R.id.apply_score_manage_listview_StuName);
        TextView apply_score_manage_listview_CourseName = (TextView) view.findViewById(R.id.apply_score_manage_listview_CourseName);
        TextView apply_score_manage_listview_WorkerName = (TextView) view.findViewById(R.id.apply_score_manage_listview_WorkerName);
        TextView apply_score_manage_listview_Score = (TextView) view.findViewById(R.id.apply_score_manage_listview_Score);

        apply_score_manage_listview_StuName.setText(scoreManage.getStuName());
        apply_score_manage_listview_CourseName.setText(scoreManage.getCourseName());
        apply_score_manage_listview_WorkerName.setText(scoreManage.getWorkerName());
        apply_score_manage_listview_Score.setText(scoreManage.getScore());

        return view;
    }

}
